<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<script type="text/javascript">
Ext.namespace('catalog.catalog.elevCatalogAbsente');
catalog.catalog.elevCatalogAbsente.SearchPanel = Ext.extend(catalog.ComplexGrid, {
       comment:'Comentariu',
        date:'Data',
        motivata:'Tip absenta',

    initComponent:function() {
        searchURL = 'displayAbsencesClassMasterView.action?studentId=' +<%=request.getParameter("studentId")%>+'&teacherId=' +<%=request.getParameter("teacherId")%>;
        var config = {
			compSet:[{url:0,reader:0,columns:0}],
			searchFields :[[
                            'Absente pana la data:', {xtype:'datefield', name:'absenceDTO.date', width:120}
                            ]],
            urls: [searchURL],
	        readers : [[
	            {name: 'date'},
	            {name: 'comment'},
	            {name: 'motivata'}
	        ]],
            columnsArray: [[
                {header: this.date, width: 100, sortable: true, dataIndex: 'date'},
                {header: this.comment, width: 100, sortable: true, dataIndex: 'comment'},
                {header: this.motivata, width: 180, sortable: true, dataIndex: 'motivata',
                 editor: new Ext.form.ComboBox({
                      typeAhead: true,
                      triggerAction: 'all',
                      lazyRender:true,
                      name:'absenceState',
                      fieldLabel:this.valueText,
                      mode: 'local',
                      store: new Ext.data.ArrayStore({
                      id: 0,
                      fields: [
                      'myId',
                      'displayText'
                      ],
                      data: [[1, 'Nemotivata'], [2, 'Motivata']]
                      }),
                      valueField: 'myId',
                      displayField: 'displayText',
                      value:1
                      })    }

	        ]]

        }; // eo config object
        Ext.apply(this, Ext.apply(this.initialConfig, config));
        catalog.catalog.elevCatalogAbsente.SearchPanel.superclass.initComponent.apply(this, arguments);
    }
});


try {elevCatalogAbsenteLocale();} catch (e) {}

Ext.onReady(function() {
            Ext.QuickTips.init();
            var formPanel = new catalog.catalog.elevCatalogAbsente.SearchPanel();
                formPanel.store.reload();
            if (mainPanel) {
            mainPanel.getActiveTab().add(formPanel);
            mainPanel.getActiveTab().doLayout();
            } else {
            var vp = new Ext.Viewport({
            layout:'fit',
            items:[formPanel]
            });
            }
            });
</script>